{% extends "cmr_base.jinja" %}

{% block content %}
<section class="content">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-md-10 col_centered">
        {% block tab_navigation %}
        {% include "includes/app_detail_navigation.jinja" %}
        {% endblock tab_navigation %}
      </div>
    </div>
    <div class="row">
      <div class="action_bar col-xs-12 col-md-10 col_centered">
        <h1>
        {%- block page_heading -%}
          Application Details
          {% include "app_detail_action_bar.jinja" %}  
        {%- endblock page_heading -%}
        </h1>
      </div>
    </div>
    <div class="row">
      <div class="app_detail-data_display col-xs-12 col-md-10 col_centered">
      {%- block app_detail_contents -%}
        {%- for application in applications%}
          {%- if application.latest_status %}
            {%- if application.latest_status.transfer %}
              {%- include "includes/latest_status_summary_for_outgoing_transfer.jinja" %}
            {%- else %}
              {%- include "includes/latest_status_summary.jinja" %}
            {%- endif %}
          {%- elif application.incoming_transfers.exists() %}
            {%- set transfer = application.incoming_transfers.first() %}
              {%- include "includes/latest_status_summary_for_incoming_transfer.jinja" %}
          {%- else %}
              {%- include "includes/empty_status_summary.jinja" %}
          {%- endif %}
        {%- endfor %}
      {%- include "formation/intake_display.jinja" %}
      {%- endblock app_detail_contents -%}
      </div>
    </div>
  </div>
</section>
{% endblock content %}
